/**
 * 函数防抖
 */
export default function (fn, duration) {
    let timer = null;
    return (...arg) => {
        clearTimeout(timer);
        timer = setTimeout(() => {
            fn(...arg);
        }, duration)
    }
}